<!--<a href="#" class="selected-language"><img src="<?php /* echo $this->getFlagImageUrl($selectedLocaleId); */ ?>" /></a>
<?php /* if (count($localeIds) > 0) : */ ?>
    <ul>
<?php /*        $domain = parse_url(Yii::app()->request->getHostInfo(), PHP_URL_HOST);
  $num = 0;
  foreach($localeIds as $localeId) :
  $localeUrl = explode('_', $localeId);
  if (is_array($localeUrl) && count($localeUrl))
  $domain .= '/'.implode('/',$localeUrl);
  if ($localeId == $selectedLocaleId) continue;
  $num++;
 */ ?>
            <li<?php /* if ($num==1) echo ' class="first"' */ ?>><a href="<?php /* echo 'http://'.$domain.'/index.html'; */ ?>"><img src="<?php /* echo $this->getFlagImageUrl($localeId); */ ?>" /></a></li>
<?php /* endforeach; */ ?>
    </ul>
--><?php /* endif; */ ?>
<?php
/**
 * TODO:,by Brian (thuann89@gmail.com), we need to get list of language in db, not in array, now I just do a demo
 */
$languages = array(
    'vi' => Yii::t('frontend', 'Vietnamese'),
    'en' => Yii::t('frontend', 'English'),
    'ja' => Yii::t('frontend', 'Japanse'),
    'zh' => Yii::t('frontend', 'Chinese'),
);
$domain    = parse_url(Yii::app()->request->getHostInfo(), PHP_URL_HOST);
$uri       = str_replace('/' . Yii::app()->language, '', $_SERVER['REQUEST_URI']);
?>
<ul class="nav nav-pills pull-right language-selector" title="<?php echo Yii::t('frontend', 'Select Language') ?>">
    <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown" href="#"><?php echo CHtml::image(themeUrl() . '/assets/img/i18n/' . Yii::app()->language . '.png') ?> <?php echo $languages[Yii::app()->language] ?> <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <?php unset($languages[Yii::app()->language]) ?>
            <?php foreach ($languages as $locale => $language) : ?>
                <li><a href="<?php echo 'http://' . $domain . '/' . $locale . $uri ?>"><?php echo CHtml::image(themeUrl() . '/assets/img/i18n/' . $locale . '.png') ?> <?php echo $language ?></a></li>
            <?php endforeach; ?>
        </ul>
    </li>
</ul>
<?php
cs()->registerCss("#styleLanguage", "
.language-selector{
margin-right: 5px !important;
padding-top: 6px !important;
font-size: 13px; !important;
}
.language-selector img {
    width:22px !important;
}
");
